﻿using System.Collections.Generic;

namespace Hx.Infrastructure.Services
{
    /// <summary>
    /// 服务响应策略
    /// </summary>
    public interface IServiceResponseStrategy
    {
        /// <summary>
        /// GET 响应
        /// </summary>
        /// <typeparam name="T">相应类型</typeparam>
        /// <param name="url">URL</param>
        T GetResponse<T>(string url) where T : class;

        /// <summary>
        /// POST 响应
        /// </summary>
        /// <typeparam name="T">响应类型</typeparam>
        /// <param name="url">URL</param>
        /// <param name="postContent">POST内容</param>
        T PostResponse<T>(string url, IEnumerable<KeyValuePair<string, string>> postContent) where T : class;

        /// <summary>
        /// PUT 响应
        /// </summary>
        /// <typeparam name="T">响应类型</typeparam>
        /// <param name="url">URL</param>
        /// <param name="putContent">PUT内容</param>
        T PutResponse<T>(string url, IEnumerable<KeyValuePair<string, string>> putContent) where T : class;

        /// <summary>
        /// DELETE 响应
        /// </summary>
        /// <typeparam name="T">响应类型</typeparam>
        /// <param name="url">URL</param>
        T DeleteResponse<T>(string url) where T : class;
    }
}
